//$(".index_zezhao").css({"display":"block"})
setTimeout(function(){
	$(".index_zezhao").css("display","block")
},2000);
$(".xiyan").on("click",function(){
	$(".content1").css("display","none"),
	$(".crt_zhuozi").css("display","block")
})
$(".guize_content").on("click",function(){
	$(".content1").css("display","none"),
	$(".content2").css("display","block")
})
$(".guanbi_x").on("click",function(){
	$(".index_zezhao").css("display","none")
})
$(".banxiyan").on("click",function(){
	$(".content2").css("display","none"),
	$(".crt_zhuozi").css("display","block")
})
$(".scyxfxxs").on("click",function(){
	$(".zuoxitanchuang").css("display","block")
})
$(".yaoqin_x").on("click",function(){
	$(".zuoxitanchuang").css("display","none")
})
$(".xiaofangzi").on("click",function(){
	$(".content2").css("display","none"),
	$(".index_zezhao").css("display","none"),
	$(".content1").css("display","block")
})
$(".xiaofangzi2").on("click",function(){
	$(".crt_zhuozi").css("display","none"),
	$(".index_zezhao").css("display","none"),
	$(".content1").css("display","block")
})
// 欢迎弹窗页面跳转部分
$(".guanbi_huanying").on("click",function(){
	$(".huanyingtanchuang").css("display","none");
})
$(".woyaoruxi").on("click",function(){
	$(".huanyingtanchuang").css("display","none");
})
$(".chakan").on("click",function(){
	$(".crt_zhuozi").css("display","none");
	$(".mingdan").css("display","block");
})
$(".zhizuo").on("click",function(){
	$(".crt_zhuozi").css("display","none");
	$(".content1").css("display","block");
})

//排行榜页面弹窗
$(".xiaofangzi3").on("click",function(){
	$(".mingdan").css("display","none");
	$(".content1").css("display","block");
})

//***
$(".xijiu").click(function(){
	$(".content1").css("display","none");
	$(".b2_page2").css("display","block");
})

$(".b2_page2 .weizhi").click(function(){
	$(".b2_page2").css("display","none");
	$(".b2_page1").css("display","block");
})

$(".b2_page1 .weizhi").click(function(){
	$(".b2_page1").css("display","none");
	$(".b2_page2").css("display","block");
})
$(".find_btn").click(function(){
	$(".find_btn").parent().css("display","none");
	$(".b2_page3").css("display","block");
})

$(".home_btn").click(function(){
	$(".home_btn").parent().css("display","none");
	$(".content1").css("display","block");
})

$(".chakan").on("click",function(){
	$(".crt_zhuozi").css("display","none");
	$(".mingdan").css("display","block");
})
$(".zhizuo").on("click",function(){
	$(".crt_zhuozi").css("display","none");
	$(".content1").css("display","block");
})

//排行榜页面弹窗
$(".xiaofangzi3").on("click",function(){
	$(".mingdan").css("display","none");
	$(".content1").css("display","block");
})

//**************桌子部分js
$(".content").on("touchstart", ".tjz",function(e){
	e.stopPropagation();
	var str='<div class="kz tjz"><div class="cet_zhuo"><p>+</p></div><div class="xzhuo xzhuo1"><img src="img/btn2_page1/images/xiaozhuo_03.png"/></div><div class="xzhuo xzhuo2"><img src="img/btn2_page1/images/xiaozhuo_03.png"/></div><div class="xzhuo xzhuo3"><img src="img/btn2_page1/images/xiaozhuo_03.png"/></div><div class="xzhuo xzhuo4"><img src="img/btn2_page1/images/xiaozhuo_03.png"/></div><div class="xzhuo xzhuo5"><img src="img/btn2_page1/images/xiaozhuo_03.png"/></div><div class="xzhuo xzhuo6"><img src="img/btn2_page1/images/xiaozhuo_03.png"/></div></div>'
	$(".content").append(str);
	$(".tjz p").text("新添加")
	$(this).attr("class","kz czz");
	$(".tjz p").text("+")
	
})
var webWidth=$(".b2_page1").width()/2;//获取屏幕的宽
var webHeight=$(".b2_page1").height()/2;//获取屏幕的高

function zouzhong(e){//让桌子移到中间
	e.stopPropagation();
//	$(".crt_zhuozi").css("opacity",0)
	var zzw = $(this).offset().left + $(this).width() / 2;
	var zzh = $(this).offset().top + $(this).height() / 2;
	$(this).animate({ x: webWidth - zzw, y: webHeight - zzh, scale: 1.5 });
	$(this).siblings().css("opacity",0);
	$(this).parent().css("overflow","hidden");
	$(this).one("touchstart",huiqu);
}

function huiqu(e){
	
	$(this).animate({ x: 0, y: 0, scale: 1 }, function() {
		$(".content").one("touchstart",".czz",zouzhong);
		$(this).parent().css("overflow","scroll");
		$(this).siblings().css("opacity",1);
	})
}
$(".content").one("touchstart",".czz",zouzhong);



//页面弹出窗和点击分享弹出窗
setTimeout(function(){
	$(".huanyingtanchuang").css("display","block")
},2000);
$(".scxy_btn").on("click",function(){
	$(".zuoxitanchuang").css("display","block");
})

//暂停/播放音乐按钮
var mu = $(".music_logo");
var music = $("audio")[0];
	mu.on("click", function() {
		mu.toggleClass("music_zt");
		if(music.paused == false) {
			music.pause();
		} else {
			music.play();
		}
	})
			
//填写喜宴主人信息跳转
$(".tijiao_btn").on("click",function(){
	$(".tijiaotanchuang").css("display","block");
})
$(".tijiao_x").on("click",function(){
	$(".tijiaotanchuang").css("display","none")
})
$(".tijiao_chakan").on("click",function(){
	$(".tianxiexinxi").css("display","none");
	$(".mingdan").css("display","block");
})